<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <!--<div class="form-group">-->
    <!--    <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>-->
    <!--    <div class="col-xs-12 col-sm-8">-->
    <!--        <input id="c-category_id" data-rule="required" data-source="mental/category/index" class="form-control selectpage" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}">-->
    <!--    </div>-->
    <!--</div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    {if $config.upload.cdnurl}                   
                    <span>
                        <button type="button" id="plupload-third" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}
                        </button>
                    </span>        
                    {else/}                 
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                   {/if}
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
        <div class="col-xs-12 col-sm-8">
          <dl class="fieldlist" data-template="basictpl" data-name="row[question]">
                <dd>
                    <ins style="width: 50px;">{:__('Option')}</ins>
                    <ins style="width: 300px;">{:__('Intro')}</ins>
                    <ins style="width: 70px;">{:__('Score')}</ins>
                    <ins>{:__('维度')}</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append">
                        <i class="fa fa-plus"></i>
                        {:__('Append')}
                    </a>
                </dd>
                <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="row[question]" class="form-control hide" cols="30"
                    rows="5">{$row.question|htmlentities}</textarea>
            </dl>
            <script id="basictpl" type="text/html">
                <dd class="form-inline">
                    <ins style="width:50px;">
                        <input style="width:50px;" type="text" name="<%=name%>[<%=index%>][option]" class="form-control" value="<%=row.option%>" placeholder="{:__('Option')}" size="5"/>
                    </ins>
                    <ins style="width:300px;">

                       <input id="t-intro<%=index%>" class="form-control"  name="<%=name%>[<%=index%>][intro]" type="text" value="<%=row['intro']%>" style="width: 222px;">
                       <button type="button" id="testUpload<%=index%>" class="btn btn-danger plupload" data-input-id="t-intro<%=index%>"data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp">
                        <i class="fa fa-upload"></i> {:__('Upload')}
    					</button>
                    </ins>
                     <ins style="width:70px;">
                         <input style="width:100%;" type="number" name="<%=name%>[<%=index%>][score]" class="form-control" value="<%=row.score%>" placeholder="{:__('Score')}"/>
                     </ins>
                     <ins style="width:70px;">
                        <input type="text" style="width:100%;" name="<%=name%>[<%=index%>][dimension]" class="form-control" value="<%=row.dimension%>"/>                        
                     </ins>
                        <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove">
                        <i class="fa fa-times"></i>
                    </span>
                    <span class="btn btn-sm btn-primary btn-dragsort">
                        <i class="fa fa-arrows"></i>
                    </span>
                </dd>
            </script>
        </div>
    </div>
    
    
    <!--<div class="form-group">-->
    <!--    <label class="control-label col-xs-12 col-sm-2">维度:</label>-->
    <!--    <div class="col-xs-12 col-sm-8">-->
    <!--        <input id="c-dimensionKey" class="form-control" name="row[dimensionKey]" type="text" value="{$row.dimensionKey}">-->
    <!--    </div>-->
    <!--</div>-->
   <!--  <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-answer" class="form-control" name="row[answer]" type="text" value="{$row.answer|htmlentities}">
        </div>
    </div> -->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
